<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateArticleInPress extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('in_press_articles', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('journal_id')->index();
            $table->string('title');
            $table->string('title_cn')->nullable();
            $table->string('doi_number')->nullable();
            $table->text('abstract')->nullable();
            $table->text('abstract_cn')->nullable();
            $table->text('authors')->nullable();
            $table->text('affiliation')->nullable();
            $table->string('keywords')->nullable();
            $table->text('fund_info')->nullable();
            $table->string('images')->nullable();
            $table->string('pdf')->nullable();
            $table->date('publish_date')->nullable();
            $table->integer('download_count')->default(0);
            $table->integer('view_count')->default(0);
            $table->tinyInteger('is_online')->default(1);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('in_press_articles');
    }
}
